<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>绝对定位布局</title>
	  <style>
	  
.container {
    position: relative;
    width: 300px;
    height: 200px;
    background-color: lightgray;
    border: 1px solid gray;
    margin: 20px;
}

.box {
    width: 100px;
    height: 50px;
    background-color: lightgreen;
    border: 1px solid green;
}

.absolute {
    position: absolute;
    top: 50px;
    left: 50px;
}
	  	  </style>
</head>

<body>
    <div class="container">
        <div class="box absolute">绝对定位的盒子，相对于父容器定位</div>
    </div>
</body>

</html>